/* 智能问答页面样式 */

/* 基础布局 */
body {
    background: linear-gradient(135deg, #0084FF 0%, #0073E6 25%, #39A5FF 50%, #0084FF 75%, #0062C4 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 返回按钮 */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #0084FF;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 主容器 */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 80px;
    overflow: hidden;
}

/* 头部 */
.chat-header {
    background: linear-gradient(135deg, #0084FF, #0073E6);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.chat-title h1 {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

.chat-status {
    background: #4CAF50;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* 对话区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin: 0 10px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #0084FF, #0073E6);
    color: white;
    order: 2;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.message-content {
    max-width: 70%;
    position: relative;
}

.message-text {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    word-wrap: break-word;
}

.user-message .message-text {
    background: linear-gradient(135deg, #0084FF, #0073E6);
    color: white;
    border-bottom-right-radius: 6px;
}

.bot-message .message-text {
    border-bottom-left-radius: 6px;
}

.message-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 5px 0;
}

.message-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

.message-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover .message-actions {
    opacity: 1;
}

.copy-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* 输入区域 */
.chat-input-container {
    background: white;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 10px 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #0084FF;
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

#chatInput::placeholder {
    color: #6c757d;
}

#sendButton {
    background: linear-gradient(135deg, #0084FF, #0073E6);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sendButton:enabled:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 132, 255, 0.3);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.input-tips {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

/* 粒子背景 */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        margin-top: 60px;
        border-radius: 15px 15px 0 0;
    }
    
    .back-button {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .chat-title h1 {
        font-size: 20px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-container {
        padding: 15px;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px 20px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}